﻿@model Orion.Models.HomeIndexViewModel
@{
    ViewBag.Title = "Mínar fréttir";
    Layout = "~/Views/Shared/_WorkLayout.cshtml";
}

<h2>Mínar fréttir</h2>


     <table>
        <caption></caption>
        <thead>
            <tr>
                <td>Dagsetning</td>
                <td>Titill</td>
            </tr>
        </thead>
        <tbody>    
            @foreach (var n in Model.NewsArticle)
            {
                DateTime temp = n.ContentDate;
                <tr>
                    <td>@temp.ToString("dd MMMM yyyy")</td>
                    <td>@Html.ActionLink( n.Title, "ViewNews/"+@n.ID, "WorkNewsArticle" )</td>
                    <td>@Html.ActionLink( "Breyta", "EditNews/" + @n.ID, "WorkNewsArticle" )</td>
                    <td>@Html.ActionLink("Eyða", "DisableArticleNews/" + @n.ID, "WorkNewsArticle", new { onclick = "return confirm('Ertu viss um að þú viljir eyða fréttinni?')" })</td>
                </tr>
            }        
        </tbody>
    </table>